package store.lunangangster.nodeflow.test.el.flow._while.component;

import java.util.Random;
import org.springframework.stereotype.Component;
import store.lunangangster.nodeflow.core.component.WhileComponent;

@Component("d")
public class SpringWhileD extends WhileComponent {

  @Override
  protected boolean processWhile() {
    boolean result = new Random().nextBoolean();
    if (result) {
      System.out.println("I'm d, a WhileComponent, do again");
    } else {
      System.out.println("I'm d, a WhileComponent, stop now");
    }
    return result;
  }
}
